home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_lag_talk_looksector.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  90 lines

  1. # Jones 3D Cog Script
  2. #
  3. # lag_talk_looksector.cog
  4. #
  5. #
  6. # [DS]
  7. #
  8. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  9. # ========================================================================================
  10.  
  11. symbols
  12.     
  13.     message     startup
  14.     message     entered
  15.     message    exited
  16.     message    pulse
  17.     
  18.     sector    looksec
  19.     sound        indyline=
  20.  
  21.     int         player                    local
  22.     int        beenhere=0                    local
  23.  
  24.     float        playery =0                    local
  25.     float        playerx =0                    local
  26.     thing        player                    local
  27.     vector    playervec                    local
  28.     int        direction=0                    local
  29.     int        targdir=0        desc=0-north,1-south,2-east,3-west.
  30.     sound        music0=mus_lag_japan1.wav        local
  31.  
  32. end
  33.  
  34. # ========================================================================================
  35.  
  36. code
  37.  
  38. startup:
  39.  
  40.     player = GetLocalPlayerThing();
  41.     return;
  42.  
  43. entered:
  44.  
  45.     if (beenhere == 1) return;
  46.     if(getsenderref() != looksec) return;
  47.     setpulse(0.5);
  48.     return;
  49.  
  50. exited:
  51.  
  52.     if(getsenderref() != looksec) return;
  53.     setpulse(0.0);
  54.     return;
  55.  
  56. pulse:
  57.     
  58.     playervec = GetThingLVec(player);
  59.     playery = VectorY(playervec);
  60.     playerx = VectorX(playervec);
  61.  
  62.     if ((playery > 0) && ((playerx > -0.7) && (playerx < 0.7)))
  63.     {
  64.     direction = 0;                               //north
  65.     }
  66.     else if ((playery < 0) && ((playerx > -0.7) && (playerx < 0.7)))
  67.     {
  68.     direction = 1;                          //south
  69.     }
  70.     else if ((playerx > 0) && ((playery > -0.7) && (playery < 0.7)))
  71.     {
  72.     direction = 2;                          //east
  73.     }
  74.     else if ((playerx < 0) && ((playery > -0.7) && (playery < 0.7)))
  75.     {
  76.     direction = 3;                          //west
  77.     }
  78. #    printint(direction);
  79.     if ((direction) == (targdir))
  80.     {
  81.     PlaySoundLocal(music0, 1.0, 0.0, 0x0, 0);
  82.     PlayVoice(player, indyline, 1.0, 0);
  83.     beenhere=1;
  84.     setpulse(0.0);
  85.     }
  86.     return;
  87.  
  88. end
  89.  
  90.